import { ArrowLeftOutlined } from '@ant-design/icons';
import { Button } from 'antd';

export default function Header({ back = true, title = '' }) {
  return (
    <header className={`flex w-full items-center ${back ? 'justify-between' : 'justify-center'}`}>
      {back ? (
        <>
          <Button icon={<ArrowLeftOutlined />} onClick={() => history.back()} />
          <div className="text-xl font-bold">{title}</div>
          <div />
        </>
      ) : (
        <div className="text-xl font-bold">{title}</div>
      )}
    </header>
  );
}
